<?php

class Application_Form_FKarta extends Zend_Form {

    public function blockFields() {
        //blokowanie wszystkich pol w formularzu glownym
        foreach ($this->getElements() as $oElement) {
            $oElement->setAttrib('disabled', true);
        }
    }

    public function init() {

        $this->setMethod('post');

        $view = Zend_Layout::getMvcInstance()->getView();
        $url = $view->url(array(
            'controller' => 'klient', 'action' => 'karta-czlonkowska'
                ));
        $this->setAction($url);
        
        $imie = new Zend_Form_Element_Text('USE_imie');
        $imie->setRequired('true')
                ->setAttrib('class', 'inputbox')
                ->addFilter('StripTags')
                ->addFilter('StringTrim');

        $this->addElement($imie);

        $nazwisko = new Zend_Form_Element_Text('USE_nazwisko');
        $nazwisko->setRequired('true')
                ->setAttrib('class', 'inputbox')
                ->addFilter('StripTags')
                ->addFilter('StringTrim');

        $this->addElement($nazwisko);


        $dataWaznosci = new Zend_Form_Element_Text('KAR_data_waznosci');
        $dataWaznosci->setRequired('true')
                ->setAttrib('class', 'inputbox')
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->setDescription('Data waznosci karty');
        $this->addElement($dataWaznosci);

        $stanKonta = new Zend_Form_Element_Text('KAR_stan_konta');
        $stanKonta->setRequired('true')
                ->setAttrib('class', 'inputbox')
                ->setDescription('Stan konta')
                ->addFilter('StripTags')
                ->addFilter('StringTrim');
        $this->addElement($stanKonta);
    }

}